extends Marker2D

@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var area_2d: Area2D = $Area2D
var is_incole : bool

func _ready() -> void:
	hide()
	animation_player.play('begin')
	area_2d.body_entered.connect(_on_check_ball_entered)

func _on_check_ball_entered(body: Node2D) :
	if is_incole : return
	print("进洞")
	is_incole = true
	get_tree().current_scene.call_deferred("_change_scene")
	queue_free()
